<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id 
 * @property int $send_id 
 * @property string $to_id 
 * @property string $content 
 * @property string $type 
 * @property \Carbon\Carbon $created_at 
 */
class MessageLog extends Model
{
    const UPDATED_AT = null;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'message_log';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['id', 'send_id', 'to_id', 'content', 'type', 'created_at'];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'integer', 'send_id' => 'integer', 'created_at' => 'datetime'];



    public function sendUser()
    {
        return $this->belongsTo(User::class,'send_id');
    }

    public function toUser()
    {
        return $this->belongsTo(User::class,'to_id');
    }
}